<template>
  <div class='search'>
    <f-drawer ref='settleDrawer' title='退款详情' okText='审批'  @submit='handleSubmit' width='70%' @visibleChange='visibleChange'>
      <refund-hk-details ref='form1' v-if='drawerVisible'></refund-hk-details>
      <task-todo-form-modal ref='taskTodoFormModal' handler-name='refundAmountFormTaskDataHandler' @callback='handleSuccess'></task-todo-form-modal>
    </f-drawer>
  </div>
</template>
<script>
import RefundHkDetails from "./refund_hk_details"
import TaskTodoFormModal from "@/views/module/haiying/tasktodo/tasktodo_form_modal"
export default {
  name: "RefundHkDrawer",
  props: {},
  data() {
    return {
      refs: this.$refs,
      drawerVisible: false,
      isEdit: false,
      title: "",
      current: "form1",
      formData: {},
      forms: [
        "form1"
      ]
    }
  },
  methods: {
    showDrawer(data, formName) {
      this.formData = data
      this.refs["settleDrawer"].show(data)
      this.$nextTick(() => {
        this.refs["form1"].setData(this.formData)
      })
    },
    handleSubmit(callback) {
      this.$refs.taskTodoFormModal.open(this.formData)
    },
    visibleChange(drawerVisible) {
      this.drawerVisible = drawerVisible
    },
    handleSuccess() {
      this.$refs.settleDrawer.close()
      this.$emit("success", true)
    },
    closeDrawer() {
      this.$emit("success")
      this.$refs.settleDrawer.close()
    }
  },
  created() {
  },
  components: { RefundHkDetails,TaskTodoFormModal }
}
</script>

<style scoped lang='less' rel='stylesheet/less'>

</style>
